<html>

  <head>

    <meta name= "viewport" content= "width=device-width" http-equiv="Content-Type"/>
    <title>BMD/BDL model with 1 animated bone</title>
    <link rel="icon" type="image.jpg" href="../../images/icon.png" />
    <link rel="stylesheet" href="../../styles.css" type="text/css">

  </head>

  <body>

    <div class="start">
      <div class="title">
        <h1>BMD/BDL model with 1 animated bone</h1> 
      </div>
    </div>

    <div class="main">

      <div class="right">

        <h3>Index</h3>
        <hr>

        <p>1. <a href="../../index.html">Introduction</a></p>
        <p>2. <a href="../tutorials.html">Tutorials</a></p>
        <p>3. <a href="../resources.html">Resources</a></p>

      </div>

    <div class="left">
      
    <h2>Contents</h2>
    <hr>

				<p>1. <a href="#tools">Required tools</a></p>
				<p>2. <a href="#tutorials">Required tutorials</a></p>
				<p>3. <a href="#steps">Steps</a></p>

				<br>
    
    <hr id="tools">
    <h2>Required tools</h2>
    <hr>
    
      <p>Refer to the "Resources" section for download.</p>

      <p>- Blender</p>
      <p>- SuperBMD</p>
      <p>- j3dview</p>
      <p>- j3d animation editor</p>
      <p>- Any text editor you like (Notepad++ is recommended)</p>
      <p>- Arc Convertor</p>
      <p>- Whitehole</p>
      <p>- Wiimm's ISO Tools (to get your SMG1 dump)</p>

      <br>

    <hr id="tutorials">
    <h2>Required tutorials</h2>
    <hr>

      <p>- Basically all of the ones before this one.</p>

      <br>

    <hr id="steps">
    <h2>Steps &emsp;&emsp;&emsp; &emsp;&emsp;&emsp; &emsp;&emsp;&emsp; &emsp;&emsp;&emsp; &emsp;&emsp;&emsp; files used: <a href="https://archive.org/download/humming-owl-storage/tutorial9.zip">tutorial9.zip</a></h2>
    <hr>

      <p>I will assume you already have a <b>model</b> to which you want to apply an <b>animation</b> (<b>Fig. 1</b>).</p>

      <img src="../../images/t9/Fig. 1.jpg">
      <b><p class="idtext">(Fig. 1 - Example model for tutorial 9)</p></b>
      <br>

      <hr>
      <p><b>NOTE 1</b>: <b>animations</b> don’t apply/work with <b>collision</b>, <b>collision is static</b>. It can be changed with <b>custom code</b> but that’s something I don’t know how to do. Maybe in the future, when animation is a common thing on <b>SMG modding</b>, someone will be able to make this reality (<b>it would be very fun, interactive animations!</b>)</p>
      <hr>

      <br>

      <p>Add a new <b>Armature object</b> on scene (<b>Fig. 2</b>) and put it where you want to achieve the <b>animation</b> you want to create. In my case, as my model is a <b>wheel</b>, it needs to <b>translate</b> and <b>rotate</b>, so the center of it is the best place to put the <b>bone</b>.</p>

      <img src="../../images/t9/Fig. 2.jpg">
      <b><p class="idtext">(Fig. 2 - Armature object creation)</p></b>
      <br>

      <p>- Go to the <code>Object</code> <b>tab</b> and set the <b>parent object of the model</b> as the <b>Armature object</b> already created (<b>Fig. 3</b>).</p>

      <img src="../../images/t9/Fig. 3.jpg">
      <b><p class="idtext">(Fig. 3 - Setting the parent object of the model)</p></b>
      <br>

      <p>Change the name of the <b>Armature object</b> to whatever name you want and also change the <b>Bone</b> name to what you want (be sure to remember them, <b>Fig. 4</b>).</p>

      <img src="../../images/t9/Fig. 4.jpg">
      <b><p class="idtext">(Fig. 4 - Changing name of Armature and Bone)</p></b>
      <br>

      <p>With the <b>model selected</b>, go to the <code>Modifiers</code> <b>tab</b> and create an <b>Armature Modifier</b> for the model. Set its <code>Object</code> <b>value</b> to the <b>Armature Object</b> (<b>Fig. 5</b>) and <i>don’t</i> apply it.</p>

      <img src="../../images/t9/Fig. 5.jpg">
      <b><p class="idtext">(Fig. 5 - Changing name of Armature and Bone)</p></b>
      <br>

      <p>Then, go to the <code>Data</code> <b>tab</b> and create a <b>new vertex group</b>. Set its <b>name</b> to match the name of the <b>bone</b> of the <b>Armature object</b> (<b>Fig. 6</b>). Change to <b>Edit Mode</b> (with the model selected), select all <b>vertex</b>, and then, click on the <b>Assign button</b> (with this you are assigning all <b>vertex</b> from the model to the <b>vertex group</b>, <b>Fig. 7</b>).</p>

      <img src="../../images/t9/Fig. 6.jpg">
      <b><p class="idtext">(Fig. 6 - Creating vertex group)</p></b>
      <br>

      <img src="../../images/t9/Fig. 7.jpg">
      <b><p class="idtext">(Fig. 7 - Assigning all vertex to new vertex group)</p></b>
      <br>

      <p>Leave <b>Edit Mode</b> and enter <b>Weight Paint</b> (key shortcut <code>Ctrl + Tab</code>), your model should look <b>blue</b> (<b>unweighted</b>, <b>Fig. 8</b>).</p>

      <img src="../../images/t9/Fig. 8.jpg">
      <b><p class="idtext">(Fig. 8 - Weight Paint mode)</p></b>
      <br>

      <p><b>Weight paint</b> the model as you wish (process works like the <b>vertex paint</b>). I literally just painted it <b>red</b> completely (<b>Fig. 9</b>).</p>

      <img src="../../images/t9/Fig. 9.jpg">
      <b><p class="idtext">(Fig. 9 - Model weight painted)</p></b>
      <br>

      <hr>
      <p><b>NOTE 2</b>: this is needed to avoid a <b>SuperBMD</b> crash when converting the model.</p>
      <hr>

      <br>

      <p>Your model is ready to abandon <b>Blender</b>. Export it as an <b>FBX</b> and be sure to uncheck the <code>Add Leaf Bones</code> <b>option</b> from the <code>Armature</code> <b>tab</b> before exporting it (<b>Fig. 10</b>). You can also export it as a <b>DAE file</b> and convert that with <b>SuperBMD</b>).</p>

      <img src="../../images/t9/Fig. 10.jpg">
      <b><p class="idtext">(Fig. 10 - Exporting model)</p></b>
      <br>

      <p>Build the model with <b>SuperBMD</b> using the following command (here you have to use the <b>Armature name</b> from before, in my case it was <code>Armature</code>):</p>

      <p><code>path\to\SuperBMD.exe [FBX model] --mat [Material JSON] --texheader [Textures JSON] --rotate --root_marker [Armature name] --nosort</code></p>

      <p><b>Linux users</b>, remember to use a forward slash instead of a backslash for paths!</p>

      <br>

      <hr>
      <p><b>NOTE 3</b>: the <code>--root_marker</code> flag is new in <b>SuperBMD</b> and it is used to help identify <b>SuperBMD</b> which is the main <b>armature object</b> of the model (in this case the one named <b>Armature</b>).</p>
      <hr>

      <br>

      <p>Then, <b>open and save</b> the model with <b>j3dview</b>.</p>

      <br>

      <hr>
      <p><b>NOTE 4</b>: the model will appear <b>not rotated</b> on <b>j3dview</b> (it is an issue that can’t be avoided yet).</p>
      <hr>

      <br>

      <p>Open the <b>j3d animation editor</b> program, go to <code>File > Create Animation</code>, select <code>.bck</code> as <b>animation type</b>, set the <b>filename</b> to whatever you model is called (in my case it is <b>tutorial9</b>), set <b>1</b> as number of bones (<b>as planned</b>) and <b>1</b> as duration (convinience). Then, press the <code>create</code> <b>button</b> (<b>Fig. 11 and 12</b>).</p>

      <img src="../../images/t9/Fig. 11.jpg">
      <b><p class="idtext">(Fig. 11 - Creating a new animation)</p></b>
      <br>

      <img src="../../images/t9/Fig. 12.jpg">
      <b><p class="idtext">(Fig. 12 - General look of an animation project)</p></b>
      <br>

      <p>You will get something as shown on <b>Fig. 12</b>.</p>

      <br>

      <hr>

      <p><b>Quick explanation of some of the stuff shown in Fig. 12:</b></p>

      <p><b>1)</b> The <code>duration</code> <b>field</b> uses the <code>Frame</code> <b>time unit</b> (as a reference use <b>60 frames per second</b> to convert frames to seconds).</p>
      <p><b>2)</b> The <code>Loop Mode</code> <b>field</b> has several options that define the <b>looping nature</b> of the <b>animation</b> (<b>I smart :P</b>).</p>
      <p><b>3)</b> The buttons on the <b>bottom-left</b> of the program <b>create/delete rows and columns</b> on the <b>main animation table</b>.</p>
      <p><b>4)</b> <b>The first 3 columns</b> of every <b>animation table</b> are related to the <b>bones</b>, <b>the tangent interpolation</b> thing (have absolutely no idea what that means, maybe how it is the <b>animation timing</b>) and <b>the components of the animation</b> respectively (<b>position, rotation, scaling</b>). <b>The rest of columns</b> are designed to input the data for <b>each frame of the animation</b> (a continuous set of frames or particular frames).</p>
      <p><b>5)</b> <b>Each set of 10 rows</b> correspond to <b>all the animation data storage a single bone can hold</b>, in other words, with those <b>10 rows</b> you input the <b>position, rotation and scaling of one bone of your animated model</b> (for more bones you click on the <code>Add Material/Bone</code> button on the <b>bottom-left</b>).</p>
      <p><b>6)</b> The <code>Joint 0</code> corresponds to the <b>first bone</b> of the <b>animation</b> (<b>the outermost one on Blender</b> - in this case, the single bone, <code>Bone0</code>).</p>

      <p><i>- This program is amazing!</i></p>

      <hr>

      <br>

      <p>I want my <b>animation</b> to be <b>200 frames long</b> and as it is a <b>wheel</b>, it will <b>rotate around the Z axis</b> and <b>translate in the X direction</b> (use the <b>Nintendo reference system - Y axis is up</b>) it will have a <code>Mirror Loop</code> mode. And, because I only need to set the values for <b>2 frames</b>, at the end the <b>animation table</b> will look as shown on <b>Fig. 13</b>.</p>

      <img src="../../images/t9/Fig. 13.jpg">
      <b><p class="idtext">(Fig. 13 - Tutorial animation values)</p></b>
      <br>

      <hr>

      <p><b>NOTE 5</b>: I can’t really explain how you should know which data is to be put in <b>each frame</b> as it is almost a blind process. Your best bet would be using <b>Whitehole</b> in conjunction with how your model looks on <b>Blender</b> to know how your <b>animation</b> might go and input the data in each <b>frame</b> as you like (<b>j3dview</b> can be used as well).</p>

      <p><b>NOTE 6</b>: You can leave some values on the <b>frames</b> that aren’t the first one <b>in blank</b>. This behavior is pretty nice as you only need to fill the fields that you want.</p> 
      <hr>

      <br>

      <p>Then, <b>save the animation</b> in a location (go to <code>File > Save... > Save As</code>) and test it with your model on <b>j3dview</b>.</p>

      <br>

      <hr>
      <p><b>NOTE 7</b>: your <b>not rotated object</b> will <b><i>magically</i></b> position itself correctly when the <b>animation</b> is applied to it on <b>j3dview</b> and on <b>game</b>.</p>

      <p><b>NOTE 8</b>: <b>Mirror Loops</b> don’t show for some reason on <b>j3dview</b>.</p>
      <hr>

      <br>

      <p>If everything shows correctly, pack your <b>BCK</b> and <b>BDL</b> files on an <b>ARC</b> file and test the <b>animated model on game!</b> (<b>Vid. 1</b>).</p>
      
      <iframe id="embed" src="https://www.youtube.com/embed/mEXackYvHC0?si=8b_2BLV6fxvTj5lC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
      
      <b><p class="idtext">(Vid. 1 - Tutorial animated model on game)</p></b>
      <br>

      <hr>
      <p><b>NOTE 9</b>: basically before making an <b>animation</b> to your model you have to already know which <b>animation</b> you want for your model (<i><b>yikes</b></i>).</p>
      <hr>

      <br>

    </div>

    </div>

  </body>

</html>
